package com.zb.javabean;

import lombok.Data;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Repository;

import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;

/**
 * @Author: 张波
 * @Time: 2025/8/19 19:15
 */
@Data
@Repository
@Scope("singleton")//教师为单例
public class Teacher {
	@Value("10000")
	private int teaID;
	@Value("艾老师")
	private String teaName;
	@Value("100000")
	private String teaPhone;
	@Value("男")
	private String teaGander;

	public Teacher() {
		System.out.println("教师被加载");
	}
	//	初始化方法
	@PostConstruct
	public void init(){
		System.out.println("老师好");
	}
	//销毁方法
	@PreDestroy
	public void die(){
		System.out.println("老师再见");
	}
}
